package com.gh.pattern.prototype.simple;

import java.util.ArrayList;

public class CloneTest {
    public static void main(String[] args) {
        CloneTarget p = new CloneTarget();
        p.name = "gh";
        p.target = new CloneTarget();
        p.list = new ArrayList<CloneTarget>();
        p.list.add(new CloneTarget());

        System.out.println(p.target);
        System.out.println(p.list);

        try {
            CloneTarget obj = (CloneTarget) p.clone();
            System.out.println(obj.target);
            System.out.println(obj.list);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
